#include "stdafx.h"
#include "Cell.h"
#include <iostream>

Cell::Cell()	//When a Cell is created, perform these default actions.
{
	cellColor = 0;
	_pAbove = NULL;
	_pBelow = NULL;
	_pLeft = NULL;
	_pRight = NULL;
	flooded = false;
	nextTo = false;
}
void Cell::SetFlooded(bool TorF)
{
	flooded = TorF;
}
bool Cell::GetFlooded()
{
	return flooded;
}
void Cell::SetNextTo(bool TorF)
{
	nextTo = TorF;
}
bool Cell::GetNextTo()
{
	return nextTo;
}

void Cell::SetColor(int color)
{
	//Set the color according to the number passed in.
	//	0 = RED
	//	1 = GREEN
	//	2 = BLUE
	//	3 = YELLOW
	//	4 = PURPLE
	//	5 = ORANGE

	if(color == 0) { this->cellColor = 'R'; }
	if(color == 1) { this->cellColor = 'G'; }
	if(color == 2) { this->cellColor = 'B'; }
	if(color == 3) { this->cellColor = 'Y'; }
	if(color == 4) { this->cellColor = 'P'; }
	if(color == 5) { this->cellColor = 'O'; }
}
void Cell::SetpAbove(Cell * cellAbove)
{this->_pAbove= cellAbove;}

void Cell::SetpBelow(Cell * cellBelowPtr)
{this->_pBelow = cellBelowPtr;}

void Cell::SetpRight(Cell * cellRightPtr)
{this->_pRight = cellRightPtr;}

void Cell::SetpLeft(Cell * cellLeftPtr)
{this->_pLeft = cellLeftPtr;}
const Cell Cell::operator=(const Cell * right)
{
	this->cellColor=right->cellColor;
	this->flooded=right->flooded;
	this->nextTo=right->nextTo;
	this->_pAbove=right->_pAbove;
	this->_pBelow=right->_pBelow;
	this->_pLeft=right->_pLeft;
	this->_pRight=right->_pRight;
	return *this;
}
